// 集中完成路由配置
import {createRouter,createWebHashHistory} from 'vue-router'

//引入待管理的页面
import Home from '../pages/Home.vue'
import Category from '../pages/Category.vue'
import Detail from '../pages/Detail.vue'
import Setting from '../pages/Setting.vue'

//路径--页面对应关系数据包
const routes = [
  {path:'/',component:Home},
  {path:'/category',component:Category},
  {path:'/detail',component:Detail},
  {path:'/setting',component:Setting},
]

//定义路由对象
const router = createRouter({
  'history':createWebHashHistory(),  //设定路由模式（哈希模式）
  'routes':routes
})

// 导出路由对象
export default router